<?php

/**
 * @author shuang
 * @date 2016-10-27 13:50:55
 */
use yii\helpers\Url;
use common\components\MTools;

$this->title = "任务置顶";
$this->registerCssFile("/css/validate.css");
$this->registerCssFile("/js/ui-dialog.css");
$this->registerJsFile("/js/jquery.form.min.js", [\yii\web\JqueryAsset::className(), "depends" => "\yii\web\JqueryAsset"]);
$this->registerJsFile("/js/Validform_v5.3.2_min.js", [\yii\web\JqueryAsset::className(), "depends" => "\yii\web\JqueryAsset"]);
$this->registerJsFile("/js/WdatePicker.js", [\yii\web\JqueryAsset::className(), "depends" => "\yii\web\JqueryAsset"]);
$this->registerJsFile("/js/dialog-plus-min.js", [\yii\web\JqueryAsset::className(), "depends" => "\yii\web\JqueryAsset"]);
$this->registerJsFile("/js/common.js", [\yii\web\JqueryAsset::className(), "depends" => "\yii\web\JqueryAsset"]);
$this->registerJs('AjaxInitForm("#TaskTopForm", "#btnSubmit", 1);');
echo $this->render("//layouts/breadcrumb", ["url" => Url::toRoute(["tasktop", "id" => $id]), "title" => "任务置顶"]);
?>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12 well ibox float-e-margins">
            <div class="ibox-title">任务置顶</div>
            <div class="well-content ibox-content">
                <form name="TaskTopForm" method="post" action="<?php echo Url::toRoute(["tasktop", "id" => $model->id]) ?>" id="TaskTopForm" class="form-horizontal form-bordered" url="<?php echo Url::toRoute(["tasktop", "id" => $model->id]) ?>">
                    <div class="panel-body panel-body-nopadding">
                        <input type="hidden" name="hidid" id="hidid" value="<?php echo $model->id; ?>" />
                        <div class="control-group">
                            <label class="control-label">任务名称标题：</label>
                            <div class="controls text"><?php echo $model->title; ?></div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">详情：</label>
                            <div class="controls">
                                <?php if ($model->publicode): ?>
                                    公众号：<?php echo $model->publicode; ?><br/>
                                <?php endif; ?>
                                <?php if ($model->vote_address): ?>
                                    投票链接：<?php echo $model->vote_address; ?><br/>
                                <?php endif; ?>
                                <?php if ($model->description): ?>
                                    描述：<?php echo $model->description; ?>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">置顶价格(12小时)：</label>
                            <div class="controls text">
                                10  元 （设置置顶后12小时内会一直排在任务最前面直到任务结束，投手会首先做你的任务，位置有限，如果置顶不成功稍等再试，<span style="color: red">非投票任务禁止置顶</span>）
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">位置：</label>
                            <div class="controls text">
                                空余<?php echo MTools::getYiiParams("topcount") - $taskTopcount; ?>个位置  
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label"></label>
                            <div class="controls">
                                <input name="btnSubmit" id="btnSubmit" type="submit" class="span2 btn lightblue" value="置顶" />
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>